load(key).

discretize(entropy).
use_package(hypspc).
minimal_cases(2).                      %  Número de ejemplos cubiertos por cada hoja como mínimo


classes([pos,neg]).
predict(active(+drug,-class)).


% C0
rmode(2:atm(+Drug,-Atomid,#,-Number1,-Number2)).
rmode(2:mutagenic(+Drug)).
rmode(2:ames(+Drug)).
rmode(2:ashby_alert(#,+Drug,-Ring)).
rmode(2:ind(+Drug,#,-Nalerts)).
rmode(2:symbond(+Drug,+Atomid,-Atomid,#)).
rmode(2:has_property(+Drug,#,#)).
rmode(2:nitro(+Drug,-Ring)).
rmode(2:sulfo(+Drug,-Ring)).
rmode(2:sulfo(+Drug,-Ring)).
rmode(2:methyl(+Drug,-Ring)).
rmode(2:methoxy(+Drug,-Ring)).
rmode(2:amine(+Drug,-Ring)).
rmode(2:amine(+Drug,-Ring)).
rmode(2:aldehyde(+Drug,-Ring)).
rmode(2:ketone(+Drug,-Ring)).
rmode(2:ether(+Drug,-Ring)).
rmode(2:sulfide(+Drug,-Ring)).
rmode(2:alcohol(+Drug,-Ring)).
rmode(2:phenol(+Drug,-Ring)).
rmode(2:carboxylic_acid(+Drug,-Ring)).
rmode(2:ester(+Drug,-Ring)).
rmode(2:amide(+Drug,-Ring)).
rmode(2:deoxy_amide(+Drug,-Ring)).
rmode(2:imine(+Drug,-Ring)).
rmode(2:alkyl_halide(+Drug,-Ring)).
rmode(2:ar_halide(+Drug,-Ring)).
rmode(2:benzene(+Drug,-Ring)).
rmode(2:hetero_ar_6_ring(+Drug,-Ring)).
rmode(2:non_ar_6c_ring(+Drug,-Ring)).
rmode(2:non_ar_hetero_6_ring(+Drug,-Ring)).
rmode(2:six_ring(+Drug,-Ring)).
rmode(2:carbon_5_ar_ring(+Drug,-Ring)).
rmode(2:hetero_ar_5_ring(+Drug,-Ring)).
rmode(2:non_ar_5c_ring(+Drug,-Ring)).
rmode(2:non_ar_hetero_5_ring(+Drug,-Ring)).
rmode(2:five_ring(+Drug,-Ring)).
rmode(2:connected(+Ring,+Ring)).


typed_language(yes).
type(atm(drug,atomid,element,number,number)).
type(drug(drug)).
type(ames(drug)).
type(mutagenic(drug)).
type(ashby_alert(alert,drug,ring)).
type(ind(drug,alert,number)).
type(symbond(drug,atomid,atomid,number)).
type(has_property(drug,property,propval)).
type(nitro(drug,ring)).
type(sulfo(drug,ring)).
type(sulfo(drug,ring)).
type(methyl(drug,ring)).
type(methoxy(drug,ring)).
type(amine(drug,ring)).
type(amine(drug,ring)).
type(aldehyde(drug,ring)).
type(ketone(drug,ring)).
type(ether(drug,ring)).
type(sulfide(drug,ring)).
type(alcohol(drug,ring)).
type(phenol(drug,ring)).
type(carboxylic_acid(drug,ring)).
type(ester(drug,ring)).
type(amide(drug,ring)).
type(deoxy_amide(drug,ring)).
type(imine(drug,ring)).
type(alkyl_halide(drug,ring)).
type(ar_halide(drug,ring)).
type(benzene(drug,ring)).
type(hetero_ar_6_ring(drug,ring)).
type(non_ar_6c_ring(drug,ring)).
type(non_ar_hetero_6_ring(drug,ring)).
type(six_ring(drug,ring)).
type(carbon_5_ar_ring(drug,ring)).
type(hetero_ar_5_ring(drug,ring)).
type(non_ar_5c_ring(drug,ring)).
type(non_ar_hetero_5_ring(drug,ring)).
type(five_ring(drug,ring)).

type(connected(ring,ring)).
type(number =< number).
type(number >= number).



auto_lookahead(atm(Drug,Atomid, Element,Number1,Number2),[Number1]).
auto_lookahead(atm(Drug,Atomid, Element,Number1,Number2),[Number2]).
auto_lookahead(ind(Drug,Alert,Number),[Number]).



discretize(entropy).

discretization(bounds(6)).

to_be_discretized(atm(Drug,Atomid, Element , Number1, Number2),[Number1]).
rmode(1: #(C:threshold(atm(_, _,_ ,Number1,_), [Number1], C), +Number1 >= C)).
rmode(1: #(C:threshold(atm(_, _,_ ,Number1,_), [Number1], C),+Number1 =< C)).


to_be_discretized(atm(Drug,Atomid, Element , Number1, Number2),[Number2]).
rmode(1: #(C:threshold(atm(_, _,_ ,_,Number2), [Number2], C), +Number2 >= C)).
rmode(1: #(C:threshold(atm(_, _,_ ,_,Number2), [Number2], C),+Number2 =< C)).



to_be_discretized(ind(Drug,Alert,Number),[Number]).
rmode(1: #(C:threshold(ind(_, _,Number), [Number], C), +Number >= C)).
rmode(1: #(C:threshold(ind(_, _,Number), [Number], C),+Number =< C)).







